
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>章节二:常用数据类型(整数) · 信息学院</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="李航老师">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chapter3.html" />
    
    
    <link rel="prev" href="chapter1.html" />
    

    </head>
    <body>
         

<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://space.bilibili.com/378936143" target="_blank">B站</a>
      </li><li>
        <a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIzMjY0NjU5Ng==&scene=124#wechat_redirect" target="_blank">公众号</a>
      </li><li>
        <a href="https://edu.csdn.net/course/detail/32032" target="_blank">CSDN</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    c语言程序设计
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    章节一:初识C语言程序
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="chapter2.html">
            
                <a href="chapter2.html">
            
                    
                    章节二:常用数据类型(整数)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="chapter3.html">
            
                <a href="chapter3.html">
            
                    
                    章节三:常用数据类型(浮点型)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="chapter4.html">
            
                <a href="chapter4.html">
            
                    
                    章节四:数据类型转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="chapter5.html">
            
                <a href="chapter5.html">
            
                    
                    章节五:运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="chapter6.html">
            
                <a href="chapter6.html">
            
                    
                    章节六:选择结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="chapter7.html">
            
                <a href="chapter7.html">
            
                    
                    章节七:switch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="chapter8.html">
            
                <a href="chapter8.html">
            
                    
                    章节八:for循环
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    Flask Web开发
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../flask/chapter1.html">
            
                <a href="../flask/chapter1.html">
            
                    
                    章节一:flask框架入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../flask/chapter2.html">
            
                <a href="../flask/chapter2.html">
            
                    
                    章节二:模版渲染
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../flask/chapter3.html">
            
                <a href="../flask/chapter3.html">
            
                    
                    章节三:html基本标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../flask/chapter4.html">
            
                <a href="../flask/chapter4.html">
            
                    
                    章节四:项目拆分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../flask/chapter5.html">
            
                <a href="../flask/chapter5.html">
            
                    
                    章节五:路由参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../flask/chapter6.html">
            
                <a href="../flask/chapter6.html">
            
                    
                    章节六:请求与响应
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../flask/chapter7.html">
            
                <a href="../flask/chapter7.html">
            
                    
                    章节七:flask-Cookie
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../flask/chapter8.html">
            
                <a href="../flask/chapter8.html">
            
                    
                    章节八:模型数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../flask/chapter9.html">
            
                <a href="../flask/chapter9.html">
            
                    
                    章节九:单表-增删查改一
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../flask/chapter10.html">
            
                <a href="../flask/chapter10.html">
            
                    
                    章节十:单表-增删查改二
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../flask/chapter11.html">
            
                <a href="../flask/chapter11.html">
            
                    
                    章节十一:图书管理系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    gitbook文档搭建
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../book/chapter1.html">
            
                <a href="../book/chapter1.html">
            
                    
                    章节一:环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../book/chapter2.html">
            
                <a href="../book/chapter2.html">
            
                    
                    章节二:typora使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../book/chapter3.html">
            
                <a href="../book/chapter3.html">
            
                    
                    章节三:电子书搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../book/chapter4.html">
            
                <a href="../book/chapter4.html">
            
                    
                    章节四:插件安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../book/chapter5.html">
            
                <a href="../book/chapter5.html">
            
                    
                    章节五:部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >章节二:常用数据类型(整数)</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             <h2 id="&#x5B66;&#x4E60;&#x76EE;&#x6807;">&#x5B66;&#x4E60;&#x76EE;&#x6807;</h2>
<ul>
<li>&#x4E86;&#x89E3;&#x8FDB;&#x5236;&#x8F6C;&#x6362;</li>
<li>&#x638C;&#x63E1;&#x51FD;&#x6570;&#x7684;&#x8C03;&#x7528;</li>
<li>&#x638C;&#x63E1;&#x6574;&#x6570;&#x6570;&#x636E;&#x7C7B;&#x578B; char short int long</li>
<li>&#x638C;&#x63E1;&#x52A8;&#x6001;&#x8F93;&#x51FA;&#x6570;&#x636E;</li>
<li>&#x638C;&#x63E1;%d&#x8F93;&#x51FA;&#x7528;&#x6CD5;</li>
<li>&#x638C;&#x63E1;&#x5927;&#x5C0F;&#x5199;&#x4E4B;&#x95F4;&#x6570;&#x636E;&#x8F6C;&#x6362;</li>
<li>&#x53D8;&#x91CF;&#x7684;&#x5B9A;&#x4E49;</li>
</ul>
<h2 id="&#x4E86;&#x89E3;&#x8FDB;&#x5236;&#x8F6C;&#x6362;">&#x4E86;&#x89E3;&#x8FDB;&#x5236;&#x8F6C;&#x6362;</h2>
<p>&#x5728;&#x8BA1;&#x7B97;&#x673A;&#x5185;&#x5B58;&#x50A8;&#x548C;&#x8FD0;&#x7B97;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x901A;&#x5E38;&#x8981;&#x6D89;&#x53CA;&#x5230;&#x7684;&#x6570;&#x636E;&#x5355;&#x4F4D;&#x6709;&#x4EE5;&#x4E0B; 3 &#x79CD;:</p>
<p>&#x4F4D;(bit):&#x8BA1;&#x7B97;&#x673A;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x90FD;&#x662F;&#x4EE5;&#x4E8C;&#x8FDB;&#x5236;&#x6765;&#x8868;&#x793A;&#x7684;&#xFF0C;&#x4E8C;&#x8FDB;&#x5236;&#x7684;&#x4EE3;&#x7801;&#x53EA;&#x6709;&#x201C;0&#x201D; &#x201C;1&#x201D;&#x4E24; &#x4E2A;&#x6570;&#x7801;&#xFF0C;&#x91C7;&#x7528;&#x591A;&#x4E2A;&#x6570;&#x7801;(0 &#x548C; 1 &#x7684;&#x7EC4;&#x5408;)&#x6765;&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x6570;&#xFF0C;&#x5176;&#x4E2D;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x6570;&#x7801;&#x79F0;&#x4E3A;&#x4E00;&#x4F4D;&#xFF0C;&#x4F4D; &#x662F;&#x8BA1;&#x7B97;&#x673A;&#x4E2D;&#x6700;&#x5C0F;&#x7684;&#x6570;&#x636E;&#x5355;&#x4F4D;&#x3002;</p>
<p>&#x5B57;&#x8282;(Byte):&#x5728;&#x5BF9;&#x4E8C;&#x8FDB;&#x5236;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x5B58;&#x50A8;&#x65F6;&#xFF0C;&#x4EE5; 8 &#x4F4D;&#x4E8C;&#x8FDB;&#x5236;&#x4EE3;&#x7801;&#x4E3A;&#x4E00;&#x4E2A;&#x5355;&#x5143;&#x5B58;&#x653E;&#x5728;&#x4E00; &#x8D77;&#xFF0C;&#x79F0;&#x4E3A;&#x4E00;&#x4E2A;&#x5B57;&#x8282;&#xFF0C;&#x5373; 1 Byte =8 bit&#x3002;&#x5B57;&#x8282;&#x662F;&#x8BA1;&#x7B97;&#x673A;&#x4E2D;&#x4FE1;&#x606F;&#x7EC4;&#x7EC7;&#x548C;&#x5B58;&#x50A8;&#x7684;&#x57FA;&#x672C;&#x5355;&#x4F4D;&#xFF0C;&#x4E5F;&#x662F;&#x8BA1; &#x7B97;&#x673A;&#x4F53;&#x7CFB;&#x7ED3;&#x6784;&#x7684;&#x57FA;&#x672C;&#x5355;&#x4F4D;&#x3002;&#x5728;&#x8BA1;&#x7B97;&#x673A;&#x4E2D;&#xFF0C;&#x901A;&#x5E38;&#x7528; B(&#x5B57;&#x8282;)&#x3001;KB(&#x5343;&#x5B57;&#x8282;)&#x3001;MB(&#x5146;&#x5B57;&#x8282;) &#x6216; GB(&#x5409;&#x5B57;&#x8282;)&#x4E3A;&#x5355;&#x4F4D;&#x6765;&#x8868;&#x793A;&#x5B58;&#x50A8;&#x5668;(&#x5982;&#x5185;&#x5B58;&#x3001;&#x786C;&#x76D8;&#x3001;U &#x76D8;&#x7B49;)&#x7684;&#x5B58;&#x50A8;&#x5BB9;&#x91CF;&#x6216;&#x6587;&#x4EF6;&#x7684;&#x5927;&#x5C0F;&#x3002;</p>
<p>&#x5B57;&#x957F;:&#x4EBA;&#x4EEC;&#x5C06;&#x8BA1;&#x7B97;&#x673A;&#x4E00;&#x6B21;&#x80FD;&#x591F;&#x5E76;&#x884C;&#x5904;&#x7406;&#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x4EE3;&#x7801;&#x7684;&#x4F4D;&#x6570;&#xFF0C;&#x79F0;&#x4E3A;&#x5B57;&#x957F;&#x3002;&#x5B57;&#x957F;&#x662F;&#x8861;&#x91CF; &#x8BA1;&#x7B97;&#x673A;&#x6027;&#x80FD;&#x7684;&#x4E00;&#x4E2A;&#x91CD;&#x8981;&#x6307;&#x6807;&#xFF0C;&#x5B57;&#x957F;&#x8D8A;&#x957F;&#xFF0C;&#x6570;&#x636E;&#x6240;&#x5305;&#x542B;&#x7684;&#x4F4D;&#x6570;&#x8D8A;&#x591A;&#xFF0C;&#x8BA1;&#x7B97;&#x673A;&#x7684;&#x6570;&#x636E;&#x5904;&#x7406;&#x901F;&#x5EA6; &#x8D8A;&#x5FEB;&#x3002;&#x8BA1;&#x7B97;&#x673A;&#x7684;&#x5B57;&#x957F;&#x901A;&#x5E38;&#x662F;&#x5B57;&#x8282;&#x7684;&#x6574;&#x500D;&#x6570;&#xFF0C;&#x5982; 8 &#x4F4D;&#x3001;16 &#x4F4D;&#x3001;32 &#x4F4D;&#x3001;64 &#x4F4D;&#x548C; 128 &#x4F4D;&#x7B49;&#x3002;</p>
<p><strong>&#x4E86;&#x89E3;&#x5185;&#x5B58;&#x5BB9;&#x91CF;</strong></p>
<p>1.&#x5185;&#x5B58;&#x5BB9;&#x91CF; </p>
<p>1TB---&gt;1024GB </p>
<p>1GB---&gt;1024MB </p>
<p>1MB---&gt;1024KB </p>
<p>1KB---&gt;1024B </p>
<p>byte(&#x5B57;&#x8282;) 1byte---&gt;8bit(&#x4F4D;)</p>
<h2 id="&#x4E86;&#x89E3;&#x4E8C;&#x8FDB;&#x5236;&#x4E0E;&#x5341;&#x8FDB;&#x5236;&#x7684;&#x8F6C;&#x6362;">&#x4E86;&#x89E3;&#x4E8C;&#x8FDB;&#x5236;&#x4E0E;&#x5341;&#x8FDB;&#x5236;&#x7684;&#x8F6C;&#x6362;</h2>
<p>&#x5C06;&#x4E8C;&#x8FDB;&#x5236;&#x6570;&#x8F6C;&#x6362;&#x6210;&#x5341;&#x8FDB;&#x5236;
 10110 &#x8F6C;&#x6362;&#x6210;&#x5341;&#x8FDB;&#x5236;&#x6570;:&#x5148;&#x5C06;&#x4E8C;&#x8FDB;&#x5236;&#x6570; 10110 &#x6309;&#x4F4D;&#x6743;&#x5C55;&#x5F00;&#xFF0C;&#x518D;&#x5BF9;&#x5176;&#x4E58;&#x79EF;&#x76F8;&#x52A0;&#xFF0C;&#x8F6C;&#x6362;&#x8FC7;&#x7A0B;</p>
<p>&#x5982;&#x4E0B;&#x6240;&#x793A;&#x3002;</p>
<p>(10110)2=(1&#xD7;24+0&#xD7;23+1&#xD7;22+1&#xD7;21+0&#xD7;20)10</p>
<p>8421 &#x6CD5;(128 64 32 16 8 4 2 1)
1011 1101---&gt;128+0+32+16+8+4+0+1=189</p>
<h2 id="&#x4E86;&#x89E3;&#x5C06;&#x5341;&#x8FDB;&#x5236;&#x8F6C;&#x6362;&#x6210;&#x4E8C;&#x8FDB;&#x5236;&#x6570;-&#x9664;&#x4EE5;-2-&#x9006;&#x5411;&#x53D6;&#x4F59;&#x6CD5;">&#x4E86;&#x89E3;&#x5C06;&#x5341;&#x8FDB;&#x5236;&#x8F6C;&#x6362;&#x6210;&#x4E8C;&#x8FDB;&#x5236;&#x6570; &#x9664;&#x4EE5; 2 &#x9006;&#x5411;&#x53D6;&#x4F59;&#x6CD5;</h2>
<p><img src="assets/image-20231108102615662.png" alt="image-20231108102615662"></p>
<h2 id="&#x4E86;&#x89E3;&#x539F;&#x7801;&#x3001;&#x53CD;&#x7801;&#x3001;&#x8865;&#x7801;">&#x4E86;&#x89E3;&#x539F;&#x7801;&#x3001;&#x53CD;&#x7801;&#x3001;&#x8865;&#x7801;</h2>
<p>37:0010 0101---&gt;0010 0101---&gt;0010 0101
-37:1010 0101---&gt;1101 1010---&gt;1101 1011 </p>
<p>&#x6B63;&#x6570;&#x7684;&#x539F;&#x7801;&#x3001;&#x53CD;&#x7801;&#x3001;&#x8865;&#x7801;&#x90FD;&#x662F;&#x4E00;&#x6837;&#x7684;! &#x8D1F;&#x6570;&#x7684;&#x53CD;&#x7801;&#x662F;&#x5728;&#x539F;&#x7801;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x201C;&#x7B26;&#x53F7;&#x4F4D;&#x4E0D;&#x53D8;&#xFF0C;&#x6570;&#x503C;&#x4F4D;&#x53D6;&#x53CD;&#x201D; &#x8D1F;&#x6570;&#x7684;&#x8865;&#x7801;&#x662F;&#x5728;&#x53CD;&#x7801;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x201C;&#x7B26;&#x53F7;&#x4F4D;&#x4E0D;&#x53D8;&#xFF0C;&#x6570;&#x503C;&#x4F4D;&#x52A0; 1&#x201D;</p>
<p>0&#x8868;&#x793A;&#x6B63;&#x6570; 1&#x8868;&#x793A;&#x8D1F;&#x6570;</p>
<h2 id="&#x51FD;&#x6570;&#x7684;&#x8C03;&#x7528;">&#x51FD;&#x6570;&#x7684;&#x8C03;&#x7528;</h2>
<pre><code class="lang-c">
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio.h&gt;</span></span>
<span class="hljs-comment">//&#x51FD;&#x6570;1</span>
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">m1</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8F93;&#x51FA;&#x51FD;&#x6570;m1...\n&quot;</span>);
}

<span class="hljs-comment">//&#x51FD;&#x6570;2</span>
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">m2</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8F93;&#x51FA;&#x51FD;&#x6570;2...\n&quot;</span>);

}

<span class="hljs-comment">//&#x51FD;&#x6570;&#x5165;&#x53E3;</span>
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span>
</span>{
    m1();
    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<h2 id="&#x6574;&#x6570;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x8F93;&#x51FA;">&#x6574;&#x6570;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x8F93;&#x51FA;</h2>
<p>&#x5B9A;&#x4E49;m3&#x51FD;&#x6570;&#xFF0C;&#x5728;&#x7A0B;&#x5E8F;&#x7684;&#x5165;&#x53E3;main&#x51FD;&#x6570;&#x4E2D;&#x8C03;&#x7528;&#x3001;%d&#x63A5;&#x6536;&#x6574;&#x6570;&#x7684;&#x5360;&#x4F4D;&#x7B26;</p>
<pre><code class="lang-c"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">m3</span><span class="hljs-params">()</span></span>{
    <span class="hljs-keyword">char</span> a=<span class="hljs-number">10</span>;
    <span class="hljs-keyword">short</span> b=<span class="hljs-number">11</span>;
    <span class="hljs-keyword">int</span> c=<span class="hljs-number">13</span>;
    <span class="hljs-keyword">long</span> d=<span class="hljs-number">14</span>;
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;a&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,a);<span class="hljs-comment">//10</span>
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;b&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,b);<span class="hljs-comment">//11</span>
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;c&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,c);<span class="hljs-comment">//14</span>
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;d&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,d);<span class="hljs-comment">//13</span>
}
</code></pre>
<h2 id="&#x52A8;&#x6001;&#x8F93;&#x51FA;&#x6570;&#x636E;">&#x52A8;&#x6001;&#x8F93;&#x51FA;&#x6570;&#x636E;</h2>
<p>&#x8BF7;&#x52A8;&#x6001;&#x7684;&#x8F93;&#x5165;&#x4E00;&#x4E2A;&#x6574;&#x6570;</p>
<p>&#x5B9A;&#x4E49;&#x51FD;&#x6570;m4&#xFF0C;&#x5728;&#x7A0B;&#x5E8F;&#x5165;&#x53E3; main&#x4E2D;&#x8C03;&#x7528;</p>
<pre><code class="lang-c"><span class="hljs-function"><span class="hljs-keyword">void</span>  <span class="hljs-title">m4</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> a;
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8BF7;&#x52A8;&#x6001;&#x7684;&#x8F93;&#x5165;&#x4E00;&#x4E2A;&#x6574;&#x6570;:\n&quot;</span>);
    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%d&quot;</span>,&amp;a);
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x60A8;&#x8F93;&#x5165;&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,a);

}
</code></pre>
<p>&#x8BF7;&#x52A8;&#x6001;&#x7684;&#x8F93;&#x5165;&#x4E24;&#x4E2A;&#x6574;&#x6570;</p>
<p>&#x5B9A;&#x4E49;&#x51FD;&#x6570;m4&#xFF0C;&#x5728;&#x7A0B;&#x5E8F;&#x5165;&#x53E3; main&#x4E2D;&#x8C03;&#x7528;</p>
<pre><code class="lang-c"><span class="hljs-function"><span class="hljs-keyword">void</span>  <span class="hljs-title">m5</span><span class="hljs-params">()</span>
</span>{
    <span class="hljs-keyword">int</span> a,b;
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x8BF7;&#x52A8;&#x6001;&#x7684;&#x8F93;&#x5165;&#x4E24;&#x4E2A;&#x6574;&#x6570;:\n&quot;</span>);
    <span class="hljs-built_in">scanf</span>(<span class="hljs-string">&quot;%d,%d&quot;</span>,&amp;a,&amp;b);
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x60A8;&#x8F93;&#x5165;&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,a);
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x60A8;&#x8F93;&#x5165;&#x7684;&#x6570;&#x636E;&#x662F;:%d\n&quot;</span>,b);

}
</code></pre>
<h2 id="&#x5B57;&#x7B26;&#x4E0E;&#x6570;&#x5B57;&#x4E4B;&#x95F4;&#x8F6C;&#x6362;">&#x5B57;&#x7B26;&#x4E0E;&#x6570;&#x5B57;&#x4E4B;&#x95F4;&#x8F6C;&#x6362;</h2>
<p>&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;m6&#x7684;&#x51FD;&#x3001;&#x5C06;&#x6570;&#x5B57;99&#x8F6C;&#x6362;&#x6210;&#x5B57;&#x6BCD;&#xFF0C;&#x5C06;&#x5B57;&#x6BCD;A&#x8F6C;&#x6362;&#x6210;&#x6570;&#x5B57;&#x3002;</p>
<p>%d&#x8F93;&#x51FA;&#x6574;&#x6570;&#x3001;%c&#x8F93;&#x51FA;&#x5B57;&#x7B26;(&#x5B57;&#x6BCD;)</p>
<pre><code class="lang-c"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">m6</span><span class="hljs-params">()</span></span>{
    <span class="hljs-keyword">char</span> a=<span class="hljs-number">99</span>;
    <span class="hljs-keyword">char</span> b=<span class="hljs-string">&apos;A&apos;</span>;
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x6570;&#x5B57;&#x8F6C;&#x6362;&#x5B57;&#x6BCD;:%c\n&quot;</span>,a);<span class="hljs-comment">//c</span>
    <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;&#x5B57;&#x6BCD;&#x8F6C;&#x6570;&#x5B57;:%d\n&quot;</span>,b);<span class="hljs-comment">//65</span>

}
</code></pre>
<h2 id="&#x53D8;&#x91CF;&#x5B9A;&#x4E49;&#x89C4;&#x8303;">&#x53D8;&#x91CF;&#x5B9A;&#x4E49;&#x89C4;&#x8303;</h2>
<p>&#x53D8;&#x91CF;&#x7684;&#x6982;&#x5FF5;:&#x503C;&#x53EF;&#x4EE5;&#x53D1;&#x751F;&#x6539;&#x53D8;&#x7684;&#x91CF; </p>
<p>&#x5B9A;&#x4E49;&#x8BED;&#x6CD5;:</p>
<p>&#x7C7B;&#x578B;&#x540D; &#x53D8;&#x91CF;&#x540D;,&#x53D8;&#x91CF;&#x540D;,&#x53D8;&#x91CF;&#x540D;;</p>
<p>&#x7C7B;&#x578B;&#x540D; &#x53D8;&#x91CF;&#x540D; = &#x521D;&#x503C;,&#x53D8;&#x91CF;&#x540D; = &#x521D;&#x503C;;</p>
<p>&#x7C7B;&#x578B;&#x540D; &#x53D8;&#x91CF;&#x540D;=&#x521D;&#x59CB;&#x503C;;</p>
<pre><code class="lang-c"><span class="hljs-keyword">char</span> a,b,c,d;<span class="hljs-comment">//&#x5B9A;&#x4E49;&#x591A;&#x4E2A;&#x53D8;&#x91CF; a b c d&#x90FD;&#x662F;char&#x7C7B;&#x578B;&#xFF0C;&#x4F46;&#x6CA1;&#x6709;&#x503C;</span>
<span class="hljs-keyword">char</span> a1=<span class="hljs-number">10</span>,b1=<span class="hljs-number">20</span>,c1=<span class="hljs-number">30</span>,d1=<span class="hljs-number">40</span>;<span class="hljs-comment">//&#x5B9A;&#x4E49;&#x591A;&#x4E2A;&#x53D8;&#x91CF;&#x6709;&#x503C;</span>
<span class="hljs-keyword">char</span> a2=<span class="hljs-number">10</span>;<span class="hljs-comment">//&#x5B9A;&#x4E49;&#x5355;&#x4E2A;&#x53D8;&#x91CF;&#x6709;&#x503C;</span>
<span class="hljs-keyword">char</span> a3;<span class="hljs-comment">//&#x5B9A;&#x4E49;&#x5355;&#x4E2A;&#x53D8;&#x91CF;&#x6CA1;&#x6709;&#x503C;</span>
</code></pre>
<p>1.&#x53D8;&#x91CF;&#x540D;&#x4E0D;&#x80FD;&#x91CD;&#x590D;</p>
<p>2.&#x53D8;&#x91CF;&#x547D;&#x540D;&#x89C4;&#x5219;&#x5982;&#x4E0B;:</p>
<p>&#x53D8;&#x91CF;&#x540D;&#x4EE5;&#x5B57;&#x6BCD;&#x3001;&#x6570;&#x5B57;&#x3001;&#x4E0B;&#x5212;&#x7EBF;&#x6784;&#x6210;&#x4E14;&#x7B2C;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E0D;&#x80FD;&#x662F;&#x6570;&#x5B57;&#xFF0C;&#x8981;&#x7B26;&#x5408;&#x6807;&#x8BC6;&#x7B26;&#x7684;&#x547D;&#x540D;&#x89C4;&#x8303;&#xFF0C; &#x4E14;&#x4E0D;&#x80FD;&#x662F;&#x7CFB;&#x7EDF;&#x5360;&#x7528;&#x7684;&#x5355;&#x8BCD;&#xFF0C;&#x5982;&#x5173;&#x952E;&#x5B57; int&#x3001;&#x9884;&#x5B9A;&#x4E49;&#x6807;&#x8BC6;&#x7B26; printf &#x7B49;&#x3002;
 char 8Tom;//&#x9519;&#x8BEF;&#x7684;&#xFF0C;&#x6570;&#x5B57;&#x4E0D;&#x80FD;&#x4F5C;&#x4E3A;&#x7B2C;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;
 char Tom MJ;//&#x9519;&#x8BEF;&#x7684;&#xFF0C;&#x6709;&#x7A7A;&#x683C;
 char Tom_MJ;//&#x6B63;&#x786E;&#x7684;
 char MJ8;//&#x6B63;&#x786E;&#x7684;
 int a<em>b;//&#x9519;&#x8BEF;&#x7684;&#xFF0C;</em>&#x4E0D;&#x7B26;&#x5408;&#x6807;&#x8BC6;&#x7B26;&#x547D;&#x540D;&#x89C4;&#x8303;
 int ab&amp;c;//&#x9519;&#x8BEF;&#x7684;&#xFF0C;&amp;&#x4E0D;&#x7B26;&#x5408;&#x6807;&#x8BC6;&#x7B26;&#x547D;&#x540D;&#x89C4;&#x8303;
 int _ab;//&#x6B63;&#x786E;&#x7684;
 char int;//&#x9519;&#x8BEF;&#xFF0C;int &#x662F;&#x5173;&#x952E;&#x5B57;&#xFF0C;&#x4E0D;&#x80FD;&#x7528;&#x6765;&#x4F5C;&#x4E3A;&#x53D8;&#x91CF;&#x540D;
 //&#x53D8;&#x91CF;&#x540D;&#x7684;&#x5B57;&#x6BCD;&#x5206;&#x5927;&#x5C0F;&#x5199;&#xFF0C;ab &#x548C; AB &#x4E0D;&#x662F;&#x540C;&#x4E00;&#x4E2A;&#x53D8;&#x91CF;&#x540D;</p>
 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
        </div>
      </div>
      
    </div>

     
    <a
      href="chapter1.html"
      class="navigation navigation-prev "
      aria-label="Previous page: 章节一:初识C语言程序"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="chapter3.html"
      class="navigation navigation-next "
      aria-label="Next page: 章节三:常用数据类型(浮点型)"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"章节二:常用数据类型(整数)","level":"1.2.2","depth":2,"next":{"title":"章节三:常用数据类型(浮点型)","level":"1.2.3","depth":2,"path":"c/chapter3.md","ref":"c/chapter3.md","articles":[]},"previous":{"title":"章节一:初识C语言程序","level":"1.2.1","depth":2,"path":"c/chapter1.md","ref":"c/chapter1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-sharing","-search","-favicon","code","expandable-chapters","theme-lou","back-to-top-button","search-pro","flexible-alerts","chapter-fold"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"search-pro":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link"],"color":"#2096FF","copyright":{"author":"李航老师"},"forbidCopy":true,"logo":"assets/logo.png","titleColor":{"h1":"#8b008b","h2":"#20b2aa","h3":"#a52a2a"},"search-placeholder":"众里寻他千百度","copyrightLogo":"assets/copyright.png","favicon":"assets/favicon.ico","autoNumber":3},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"flexible-alerts":{"style":"callout","note":{"label":"Note","icon":"fa fa-info-circle","className":"info"},"tip":{"label":"Tip","icon":"fa fa-lightbulb-o","className":"tip"},"warning":{"label":"Warning","icon":"fa fa-exclamation-triangle","className":"warning"},"danger":{"label":"Attention","icon":"fa fa-ban","className":"danger"}},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"李航老师","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://space.bilibili.com/378936143","name":"B站"},{"target":"_blank","url":"https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIzMjY0NjU5Ng==&scene=124#wechat_redirect","name":"公众号"},{"target":"_blank","url":"https://edu.csdn.net/course/detail/32032","name":"CSDN"}]}},"title":"信息学院","gitbook":"*","description":"Gitbook电子书示例项目"},"file":{"path":"c/chapter2.md","mtime":"2023-11-08T03:14:27.495Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-12-07T03:21:22.004Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/jweixin-1.6.0.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

